package com.chenjf.controller;

import com.chenjf.feign.HystrixClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("tests")
public class TestController {

    @Autowired
    private HystrixClient hystrixClient;

    @GetMapping("test1")
    public String test1() {
        //调用hystrix中的方法
        String s = hystrixClient.test1(1);
        System.out.println("s = " + s);
        System.out.println("openfeign");
        return "openfeign ok!";
    }
}
